<template>
  <base-breadcrumb>
    <template>
      <a-card class="table-page-search-wrapper">
        <titleName title="信息详情" />
        <a-form
          :label-col="{ lg: { span: 6 }, sm: { span: 6 } }"
          :wrapper-col="{ lg: { span: 16 }, sm: { span: 16 } }"
        >
          <a-row :gutter="24">
            <!-- <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item label="岗位责任书名称">
                {{ objFrom.name }}
              </a-form-item>
            </a-col> -->
            <!-- <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item label="所属分公司">
                {{ objFrom.branchComName }}
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item label="所属项目">
                {{ objFrom.projectName }}
              </a-form-item>
            </a-col> -->
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item label="所属单位">
                {{ objFrom.branchComName + '/' + objFrom.projectName }}
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item label="签订完成日期">
                {{ objFrom.signFinishDate  }}
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item label="填报人">
                {{ objFrom.creatorName }}
              </a-form-item>
            </a-col>
            <a-col
              :md="8"
              :sm="8"
            >
              <a-form-item label="填报时间">
                {{ objFrom.createTime }}
              </a-form-item>
            </a-col>
          </a-row>
        </a-form>
      </a-card>
    </template>
    <!-- 附件 -->
    <a-card>
      <titleName title="岗位责任书" />
      <a-table
        :columns="enclosure"
        :data-source="dataSource"
        :pagination="false"
      >
        <span
          slot="serial"
          slot-scope="text, record, index"
        >{{ index + 1 }}</span>
        <span
          slot="fileList"
          slot-scope="text, record"
        >
          <file-link :file-list="record.fileList" />
          <!-- <template>
                        <span v-for="(item, idx) in record.fileList" :key="idx">
                            <a
                                :href="
                                    '/api/ycloud-file-center/oper/download?access_token=' +
                                    token +
                                    '&fileId=' +
                                    item.fileId
                                "
                                >{{ item.fileName }}{{ item.suffixName }}</a
                            > </span
                        >&nbsp;
                    </template> -->
        </span>
      </a-table>
    </a-card>
    <div class="tool-btns page-btn-right-top" v-if="!$route.query.businessId">
      <a-button
        class="ml20"
        type="primary"
        @click="closeForm"
      >
        关闭
      </a-button>
    </div>
  </base-breadcrumb>
</template>

<script>
import { detailed } from '@/api/businessAffairs/postReporting'
import Vue from 'vue'
const enclosure = [
    {
        title: '序号',
        width: '80px',
        scopedSlots: { customRender: 'serial' },
    },
    {
        title: '姓名',
        dataIndex: 'employeeName',
    },
    {
        title: '所属部门',
        dataIndex: 'deptName',
    },
    {
        title: '责任书名称',
        dataIndex: 'responsibilityBook',
    },
    {
        title: '签订日期',
        dataIndex: 'signDate',
    },
    {
        title: '岗位责任书文件',
        dataIndex: 'fileList',
        scopedSlots: { customRender: 'fileList' },
    },
]
export default {
    name:'a'+Date.now(),
    methods: {
        closeForm() {
            this.$multiTab.close(this.$route.fullpath)
        },
    },
    mounted() {
        this.token = Vue.getAcloudProvider().getAccessToken()
        detailed(this.$route.query.id).then((res) => {
            this.objFrom = res.data
            this.dataSource = res.data.jobResponsibilityVOS
        })
    },
    data() {
        this.enclosure = enclosure
        return {
            objFrom: '',
            dataSource: [],
            token: '',
        }
    },
}
</script>

<style>
</style>